<!DOCTYPE html>
<html>
  <head>
    <title>iOS and Js</title>
    <style type="text/css">
      * {
        font-size: 40px;
      }
    </style>
  </head>
  
  <body>
    
    <div style="margin-top: 100px">
      <h1>测试使用</h1><br/>
      <div><input type="button" value="上传图片" onclick="uploadPhoto()"></button></div>
      <br/>
      <div><input type="button" value="浏览图片" onclick="previewPhoto()"></button></div>

    </div>
    <br/>
    
    <div id="SwiftDiv">
      <span id="jsParamFuncSpan" style="color: red; font-size: 50px;"></span>
    </div>
    
    
    <script type="text/javascript">
        function callJsAlert() {
            alert('Objective-C call js to show alert');
            
            window.webkit.messageHandlers.photo.postMessage({body: 'call js alert in js'});
        }
      function uploadPhoto() {
        
        window.webkit.messageHandlers.photo.postMessage({method: 'uploadPhoto'});
      }
      function previewPhoto() {
        
        window.webkit.messageHandlers.photo.postMessage({method: 'previewPhoto'});
      }
      </script>
    
  </body>
</html>
